package com.bwie.product.es;

import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

import java.math.BigDecimal;

/**
 * 产品ES
 *
 * @author <a href="mailto:2943147140@qq.com">刘洋朔</a>
 * @version 1.0
 * @description: 产品ES
 * @date 2025/9/9 14:23
 */
@Data
@IndexName("product")
public class ProductES {
    /**
     * 序号
     */
    @IndexId(type = IdType.CUSTOMIZE)
    private String id;
    /**
     * 产品名称
     */
    @IndexField(fieldType = FieldType.TEXT,analyzer = "ik_max_word")
    @HighLight(preTag = "<em style=\"color:red\">" ,postTag = "</em>")
    private String productName;
    /**
     * 产品分类
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String productType;

    /**
     * 产品分类(dict)
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String dictProductType;

    /**
     * 库存
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer inventory;
    /**
     * 价格
     */
    @IndexField(fieldType = FieldType.DOUBLE)
    private BigDecimal price;
}
